package com.feihong.txgw.tx_model;

import com.feihong.txgw.inter.contract.order.IReviewOrderContract;
import com.feihong.txgw.utils.helper.RxHelper;
import com.feihong.txgw.utils.manage.RetrofitManager;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName ReviewOrderMainModel
 * @package com.feihong.txgw.tx_model
 * @data 2018/5/7 13:56
 * @Describe
 * @Change
 */
public class ReviewOrderMainModel implements IReviewOrderContract.IReviewOrderMainModel {

    public static ReviewOrderMainModel create(){
        return new ReviewOrderMainModel();
    }

    @Override
    public Observable<String> getOrderGoodsInfo(String tableID, String orderID) {
        return RetrofitManager.getInstance().getTerminalOrderInfo(tableID, orderID).compose(RxHelper.<String>rxSchedulerHelper());
    }

    @Override
    public Observable submitReview(String orderSn, String type, String delivery_rand, String serviceRand, String goodsInfo) {
        return RetrofitManager.getInstance().submitOrderReview(orderSn, type, delivery_rand, serviceRand, goodsInfo).compose(RxHelper.<String>rxSchedulerHelper());
    }
}
